3.45 \(\int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx\)

Optimal. Leaf size=83 \[ -\frac {a^4 \cot (c+d x)}{d}+\frac {4 a^3 b \log (\tan (c+d x))}{d}+\frac {6 a^2 b^2 \tan (c+d x)}{d}+\frac {2 a b^3 \tan ^2(c+d x)}{d}+\frac {b^4 \tan ^3(c+d x)}{3 d} \]

[Out]

-a^4*cot(d*x+c)/d+4*a^3*b*ln(tan(d*x+c))/d+6*a^2*b^2*tan(d*x+c)/d+2*a*b^3*tan(d*x+c)^2/d+1/3*b^4*tan(d*x+c)^3/
d

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3516, 43} \[ \frac {6 a^2 b^2 \tan (c+d x)}{d}+\frac {4 a^3 b \log (\tan (c+d x))}{d}-\frac {a^4 \cot (c+d x)}{d}+\frac {2 a b^3 \tan ^2(c+d x)}{d}+\frac {b^4 \tan ^3(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]^2*(a + b*Tan[c + d*x])^4,x]

[Out]

-((a^4*Cot[c + d*x])/d) + (4*a^3*b*Log[Tan[c + d*x]])/d + (6*a^2*b^2*Tan[c + d*x])/d + (2*a*b^3*Tan[c + d*x]^2
)/d + (b^4*Tan[c + d*x]^3)/(3*d)

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3516

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[(x^m*(a + x)^n)/(b^2 + x^2)^(m/2 + 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps

\begin {align*} \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx &=\frac {b \operatorname {Subst}\left (\int \frac {(a+x)^4}{x^2} \, dx,x,b \tan (c+d x)\right )}{d}\\ &=\frac {b \operatorname {Subst}\left (\int \left (6 a^2+\frac {a^4}{x^2}+\frac {4 a^3}{x}+4 a x+x^2\right ) \, dx,x,b \tan (c+d x)\right )}{d}\\ &=-\frac {a^4 \cot (c+d x)}{d}+\frac {4 a^3 b \log (\tan (c+d x))}{d}+\frac {6 a^2 b^2 \tan (c+d x)}{d}+\frac {2 a b^3 \tan ^2(c+d x)}{d}+\frac {b^4 \tan ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.21, size = 162, normalized size = 1.95 \[ -\frac {\csc (c+d x) \sec ^3(c+d x) \left (4 \left (3 a^4+b^4\right ) \cos (2 (c+d x))+\left (3 a^4+18 a^2 b^2-b^4\right ) \cos (4 (c+d x))+3 \left (3 a^4+4 a^3 b \sin (4 (c+d x)) (\log (\cos (c+d x))-\log (\sin (c+d x)))+8 a b \sin (2 (c+d x)) \left (-a^2 \log (\sin (c+d x))+a^2 \log (\cos (c+d x))-b^2\right )-6 a^2 b^2-b^4\right )\right )}{24 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]^2*(a + b*Tan[c + d*x])^4,x]

[Out]

-1/24*(Csc[c + d*x]*Sec[c + d*x]^3*(4*(3*a^4 + b^4)*Cos[2*(c + d*x)] + (3*a^4 + 18*a^2*b^2 - b^4)*Cos[4*(c + d
*x)] + 3*(3*a^4 - 6*a^2*b^2 - b^4 + 8*a*b*(-b^2 + a^2*Log[Cos[c + d*x]] - a^2*Log[Sin[c + d*x]])*Sin[2*(c + d*
x)] + 4*a^3*b*(Log[Cos[c + d*x]] - Log[Sin[c + d*x]])*Sin[4*(c + d*x)])))/d

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 159, normalized size = 1.92 \[ -\frac {6 \, a^{3} b \cos \left (d x + c\right )^{3} \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - 6 \, a^{3} b \cos \left (d x + c\right )^{3} \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) - 6 \, a b^{3} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (3 \, a^{4} + 18 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{4} - b^{4} - 2 \, {\left (9 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2}}{3 \, d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

-1/3*(6*a^3*b*cos(d*x + c)^3*log(cos(d*x + c)^2)*sin(d*x + c) - 6*a^3*b*cos(d*x + c)^3*log(-1/4*cos(d*x + c)^2
 + 1/4)*sin(d*x + c) - 6*a*b^3*cos(d*x + c)*sin(d*x + c) + (3*a^4 + 18*a^2*b^2 - b^4)*cos(d*x + c)^4 - b^4 - 2
*(9*a^2*b^2 - b^4)*cos(d*x + c)^2)/(d*cos(d*x + c)^3*sin(d*x + c))

________________________________________________________________________________________

giac [A]  time = 4.04, size = 86, normalized size = 1.04 \[ \frac {b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 12 \, a^{3} b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - \frac {3 \, {\left (4 \, a^{3} b \tan \left (d x + c\right ) + a^{4}\right )}}{\tan \left (d x + c\right )}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="giac")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 12*a^3*b*log(abs(tan(d*x + c))) + 18*a^2*b^2*tan(d*x + c) -
 3*(4*a^3*b*tan(d*x + c) + a^4)/tan(d*x + c))/d

________________________________________________________________________________________

maple [A]  time = 0.54, size = 90, normalized size = 1.08 \[ -\frac {a^{4} \cot \left (d x +c \right )}{d}+\frac {4 a^{3} b \ln \left (\tan \left (d x +c \right )\right )}{d}+\frac {6 a^{2} b^{2} \tan \left (d x +c \right )}{d}+\frac {2 a \,b^{3}}{d \cos \left (d x +c \right )^{2}}+\frac {b^{4} \left (\sin ^{3}\left (d x +c \right )\right )}{3 d \cos \left (d x +c \right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x)

[Out]

-a^4*cot(d*x+c)/d+4*a^3*b*ln(tan(d*x+c))/d+6*a^2*b^2*tan(d*x+c)/d+2/d*a*b^3/cos(d*x+c)^2+1/3/d*b^4*sin(d*x+c)^
3/cos(d*x+c)^3

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 72, normalized size = 0.87 \[ \frac {b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 12 \, a^{3} b \log \left (\tan \left (d x + c\right )\right ) + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - \frac {3 \, a^{4}}{\tan \left (d x + c\right )}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 12*a^3*b*log(tan(d*x + c)) + 18*a^2*b^2*tan(d*x + c) - 3*a^
4/tan(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 3.66, size = 81, normalized size = 0.98 \[ \frac {b^4\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}-\frac {a^4\,\mathrm {cot}\left (c+d\,x\right )}{d}+\frac {6\,a^2\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,a\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d}+\frac {4\,a^3\,b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x))^4/sin(c + d*x)^2,x)

[Out]

(b^4*tan(c + d*x)^3)/(3*d) - (a^4*cot(c + d*x))/d + (6*a^2*b^2*tan(c + d*x))/d + (2*a*b^3*tan(c + d*x)^2)/d +
(4*a^3*b*log(tan(c + d*x)))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan {\left (c + d x \right )}\right )^{4} \csc ^{2}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)**2*(a+b*tan(d*x+c))**4,x)

[Out]

Integral((a + b*tan(c + d*x))**4*csc(c + d*x)**2, x)

________________________________________________________________________________________